(define (get-param-value key)
  (assoc key params))

(define (get-param-values) (alist-values params))

(define (get-param-names) (alist-keys params))

(define (get-header-value key)
  (assoc key hdrs))

(define (set-header-value key value)
  (define h (take-until-with key hdrs car))
  (define t (drop-until-with key hdrs car))
  (case ((and (not (null? h)) (not (null? t))) (append h (set-car t (cons key value))))
        ((not (null? h)) (append h (list (cons key value))))
        ((not (null? t)) (set-car t (cons key value)))))

;; usage: (set! hdrs (set-header-value key value))

(define (get-header-names) (alist-keys hdrs))

